package com.swiftride.feign;

import com.swiftride.constants.Constants;
import com.swiftride.pojo.param.PricingParam;
import com.swiftride.pojo.result.PricingResult;
import com.swiftride.pojo.result.SplitAccountResult;
import com.swiftride.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;

@FeignClient(value = Constants.Remote.SERVICE_RULE, path = "/app/pricing", contextId = "RuleFeign")
public interface AppRuleFeign {

    @PostMapping("/order")
    R<PricingResult> pricing(@RequestBody PricingParam param);

    @GetMapping("/splitAccount/{realOrderAmount}")
    R<SplitAccountResult> splitAccount(@PathVariable(value = "realOrderAmount") BigDecimal realOrderAmount);
}
